 package CurtainDesign;

 import com.sun.jimi.core.Jimi;
 import java.awt.Dimension;
 import java.awt.Frame;
 import java.awt.Graphics;
 import java.awt.Image;
 import java.awt.MediaTracker;
 import java.awt.SystemColor;
 import java.awt.Toolkit;
 import java.awt.Window;

 public class Splash extends Window
 {
   protected Image image;
   private String path;

   public Splash(String path, Frame parent)
   {
     super(parent);
     this.path = path;

     setBackground(SystemColor.desktop);
     Toolkit tk = getToolkit();
     MediaTracker tracker = new MediaTracker(this);

     this.image = Jimi.getImage(path);
     tracker.addImage(this.image, 0);
     try {
       tracker.waitForAll();
     }
     catch (InterruptedException e) {
     }
     int imgWidth = this.image.getWidth(this);
     int imgHeight = this.image.getHeight(this);
     setSize(imgWidth, imgHeight);

     Dimension screen = getToolkit().getScreenSize();
     int x = (screen.width - getSize().width) / 2;
     int y = (screen.height - getSize().height) / 2;
     setLocation(x, y);

     show();
     toFront();

     repaint();
     try {
       Thread.sleep(300L); } catch (InterruptedException e) {
     }
   }

   public void paint(Graphics g) {
     g.drawImage(this.image, 0, 0, this);
   }
 }

/* Location:           C:\Users\Administrator\Desktop\奥特百叶窗\Shutter DesignerV3.1\CurtainDesign.jar
 * Qualified Name:     CurtainDesign.Splash
 * JD-Core Version:    0.6.0
 */